import service from '@/utils/request'
const BASE_URL = 'api-user'
// 获取列表
export function teacherList(data) {
    return service({
        url: `${BASE_URL}/teachers`,
        method: 'get',
        params: data
    })
}

// 新增
export function addteacher(data) {
    return service({
        url: `${BASE_URL}/teacher`,
        method: 'post',
        data
    })
}
// 获取详情
export function teacherDetail(teacherId) {
    return service({
        url: `${BASE_URL}/teacher/${teacherId}`,
        method: 'get'
    })
}
// 编辑
export function editteacher(data) {
    return service({
        url: `${BASE_URL}/teacher`,
        method: 'put',
        data
    })
}

// 删除
export function deleteteacher(teacherId) {
    return service({
        url: `${BASE_URL}/teacher/${teacherId}`,
        method: 'delete'
    })
}


// 审核 
export function auditTeacher(data) {
    return service({
        url: `${BASE_URL}/teacher/audit`,
        method: 'put',
        data
    })
}

//教师列表
export function simpleTeacherList(teacherId) {
    return service({
        url: `${BASE_URL}/teacher/simple`+ '?teacherId=' + teacherId,
        method: 'get'
    })
}

//启用/停用
export function enableTeacher(teacherId) {
    return service({
        url: `${BASE_URL}/teacher/enable/${teacherId}`,
        method: 'put',
    })
}

//获取审批原因
export function getAuditMessage(teacherId) {
    return service({
        url: `${BASE_URL}/teacher/${teacherId}/audit-message`,
        method: 'get'
    })
}